﻿using System;

namespace DotNetCommon.Extensions;

/// <summary>
/// 扩展 byte[]
/// </summary>
public static class ByteArrayExtensions
{
    /// <summary>
    /// 将字节数组转16进制字符串
    /// </summary>
    public static string ToHex(this byte[] arr)
    {
        if (arr == null) return null;
        if (arr.Length == 0) return string.Empty;
        return Convert.ToHexString(arr);
    }
}
